<!DOCTYPE HTML>
<html>
<head>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
    <meta charset="utf-8">
    <title>Apache Velocity Example</title>
</head>
<body>
#set($foo = "Velocity")
Hello $foo World!

<div class="nav">
    <ul>
        #if(!$menuItems.empty)
        <h2>list size: $menuItems.size()</h2>
        $menuItems.set(9,'menu 9 to 10');
        $menuItems.add('menu 100');
        $menuItems.get(9)
        #set($i = 10)
        $menuItems.get($i)
        #foreach( $item in $menuItems )
        <li>
            <a href="#">
                $item
            </a>
        </li>
        #end

        #foreach($item in $menuItems)
            $foreach.first
            $foreach.last
            $foreach.count
            $foreach.parent.index
            $foreach.topmost.hasNext
            $item #if( $foreach.hasNext ),#end</br>
        #end
        #end
    </ul>
</div>

<div class="content">
    <div class="erp">
        <h2>discount: $!erpItem.getTitle()/$erpItem.off%</h2>
        <h2>discount: $!{erpItem.getDescription()}</h2>

        #set($criteria = ["name", "address","gender"])
        #foreach($criterion in $criteria)
            Key:$criterion
            #set($result = $query.containsKey($criterion))
            #if($result)
                Query was successful</br>
            #end
        #end
        </br>
        #set($foo = "bar")
        $foo
        #set($blargh = '$foo')
        $blargh
        </br>
        #if($lists)
            lists is not null.</br>
            #foreach($list int $lists)
                $list
            #end
        #end

        </br>
        #set ($key2 = "ribonucleic acid")
        #if ($key1 == $key2)
            In this case it's clear they aren't equivalent. So...
        #else
            They are not equivalent and this will be the output.
        #end

    </div>
</div>
</body>
</html>
